<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ page import="com.google.appengine.api.datastore.DatastoreService"%>
<%@ page import="com.google.appengine.api.datastore.DatastoreServiceFactory"%>
<%@ page import="com.google.appengine.api.datastore.Entity"%>
<%@ page import="com.google.appengine.api.datastore.FetchOptions"%>
<%@ page import="com.google.appengine.api.datastore.Key"%>
<%@ page import="com.google.appengine.api.datastore.KeyFactory"%>
<%@ page import="com.google.appengine.api.datastore.Query"%>
<%@ page import="com.google.appengine.api.users.User"%>
<%@ page import="com.google.appengine.api.users.UserService"%>
<%@ page import="com.google.appengine.api.users.UserServiceFactory"%>
<%@ page import="java.util.List"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:set var="contextPath" value="${pageContext.servletContext.contextPath}" />
<html>
	<head>
		<style type="text/css">
      		body {
        		padding-top: 60px;
        		padding-bottom: 40px;
      		}
    	</style>
		<link type="text/css" rel="stylesheet" href="${contextPath}/stylesheets/main.css" />
		<link type="text/css" rel="stylesheet" href="/stylesheets/bootstrap.min.css" media="screen">
	</head>

	<body>
		<c:import url="/WEB-INF/JSP/menu.jsp" />
	
		<div class="container">

		<!-- Main hero unit for a primary marketing message or call to action -->
      	<div class="hero-unit transparent">
        	<h2 class="red">Game of WaW</h2>
        	<p>Dit is een platform waarmee cursisten hun activiteiten tijdens WaW kunnen registren en interessante weetjes met elkaar kunnen delen. GoW integreert met verschillende sociale netwerken en jobsites. Door het posten en delen van informatie kunnen cursisten punten verdienen, stijgen in de ranking, om zo uiteindelijk de felbegeerde titel “King of WaW” te bemachtigen.</p>
                <p><a href="<c:url value='/info'/>" class="btn btn-primary btn-large">Opdracht &raquo;</a></p>
      	</div>
      	
      	<h1>Berichten</h1>

		<c:if test="${empty posts}">
			<p>Geen posts beschikbaar</p>
		</c:if>


		<c:if test="${not empty posts}">
			<c:forEach var="post" items="${posts}">
                            <c:url var="postURL" value="/post">
                                <c:param name="postId" value="${post.postId}"/>
                            </c:url>
				<blockquote>${fn:escapeXml(post.content)}</blockquote>
				<p>
					Geplaatst door:
					<c:if test="${not empty post.user}">${post.user.userName}</c:if>
					<c:if test="${empty post.user}">anonieme gebruiker</c:if>
				</p>
			</c:forEach>
		</c:if>

	</div>
	
	<script src="http://code.jquery.com/jquery.js"></script>
	<script src="/js/bootstrap.min.js"></script>
</body>
</html>
